<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:a4j="http://richfaces.org/a4j"
   xmlns:rich="http://richfaces.org/rich"
   xmlns:composite="http://java.sun.com/jsf/composite">

<!-- INTERFACE -->
<composite:interface>
   <composite:attribute name="user"/>
</composite:interface>

<!-- IMPLEMENTATION: REUSABLE FOR CREATE AND UPDATE ACTIONS-->
<composite:implementation>
     <h:panelGrid columns="3" border="1">
     
     <h:outputLabel for="username" value="Username:"/>
      <h:inputText id="username" value="#{cc.attrs.user.username}">
         <rich:validator immediate="true"/>
      </h:inputText>
      <rich:message for="username" errorClass="invalid"/>
     
      <h:outputLabel for="name" value="Name:"/>
      <h:inputText id="name" value="#{cc.attrs.user.surname}">
         <rich:validator immediate="true"/>
      </h:inputText>
      <rich:message for="name" errorClass="invalid"/>

      <h:outputLabel for="email" value="Email:"/>
      <h:inputText id="email" value="#{cc.attrs.user.email}">
         <rich:validator immediate="true"/>
      </h:inputText>
      <rich:message for="email" errorClass="invalid"/>

      <h:outputLabel for="phone" value="Phone #:"/>
      <h:inputText id="phone" value="#{cc.attrs.user.phone}">
         <rich:validator immediate="true"/>
      </h:inputText>
      <rich:message for="phone" errorClass="invalid"/>
   </h:panelGrid>
</composite:implementation>
</html>